function promiseAllSettled(promises){
    return new Promise((resolve, reject) => {
        if(Array.isArray(promises)){
            const result = [];
            let count = 0;
            promises.forEach((item,index) => {
                Promise.resolve(item).then(
                    value => {
                        count ++
                        result[index] = {'status': 'fulfilled', value}
                        count === promises.length && resolve(result)
                    },
                    reason => {
                        count ++
                        result[index] = {'status': 'fulfilled', reason}
                        count === promises.length && resolve(result)
                    }
                )

            })
        } else{
            reject(new TypeError(' Argaments is not iterable '))
        }
    })
}